/*
 * Copyright 2012 NJUT  qixiaobo. All rights reserved.
 */
package com.fujitsu.nanjing.tieba.model;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.fujitsu.nanjing.tieba.dao.CoreReplyDAOImpl;
import com.ibatis.sqlmap.client.SqlMapClient;
/**
 * Reply.java
 * 
 * @author Qixiaobo-win8
 */
@Repository
public class Reply extends CoreReplyDAOImpl {
	@Resource
	private SqlMapClient sqlMapClient;
	@PostConstruct
	public void initSqlMapClient() {
		super.setSqlMapClient(sqlMapClient);
	}
	/**
	 * 
	 * 根据boardId获取reply个数
	 * */
	public int countRepliesByBoardId(int boardId) {
		int count = (Integer) getSqlMapClientTemplate().queryForObject(
				"core_reply.countRepliesByBoardId", boardId);
		return count;
	}
	public int countReplies() {
		int count = (Integer) getSqlMapClientTemplate().queryForObject(
				"core_reply.countReplies");
		return count;
	}
	public int countMonthNewReplies() {
		return (Integer) getSqlMapClientTemplate().queryForObject(
				"core_reply.countMonthNewReplies");
	}
}
